from tkinter import *
from PIL import Image, ImageTk

root = Tk()
root.geometry('600x600')
root.title('按钮点击加载图片')
photo=None
img=None
def show():
    global photo
    global img
    root.geometry('600x600')
    img = Image.open('QR/wxa.jpg')  # 打开图片
    photo = ImageTk.PhotoImage(img)  # 用PIL模块的PhotoImage打开
    imglabel = Label(root, image=photo)
    imglabel.grid(row=0, column=0, columnspan=3)


btn = Button(root, text="show", command=show)
btn.grid(row=1, column=1)

mainloop()
